package com.itheima.pojo;

import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.style.column.AbstractColumnWidthStyleStrategy;
import org.apache.poi.ss.usermodel.Cell;

import java.util.List;

public class MyColumnStyle extends AbstractColumnWidthStyleStrategy {
    protected void setColumnWidth(WriteSheetHolder writeSheetHolder, List<CellData> cellDataList,
                                  Cell cell, Head head, Integer relativeRowIndex, Boolean isHead) {
         writeSheetHolder.getSheet().setColumnWidth(cell.getColumnIndex(), 4500);
    }
}